﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SaleSoft.Models;

namespace SaleSoft.Helper {
    public static class BannerHelper {
        public static List<ds_banner> GetBanner ( int? count ) {
            SaleSoftEntities db = new SaleSoftEntities();
            var banners = db.ds_banner;
            int get = 4;
            if (count.HasValue) {
                get = (banners.Count() >= count) ? count.Value : banners.Count();
            } else {
                get = banners.Count();
            }

            return banners.ToList().GetRange(0, get);
        }
    }
}